package com.littlehu.service.impl;

import com.github.pagehelper.PageHelper;
import com.littlehu.mapper.ArticleMapper;
import com.littlehu.pojo.Article;
import com.littlehu.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author littlehu
 * @data 2018/6/22 15:38
 * @Email 807115007@qq.com
 **/
@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public Article selectById(int id) {
        return articleMapper.selectById(id);
    }

    @Override
    public List<Article> selectByPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum , pageSize);
        List<Article> articleList = articleMapper.selectByPage();
        return articleList;
    }

  /*  @Override
    public Page<Article> findWithBLOBsByPage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum , pageSize);
        return articleMapper.findWithBLOBsByPage();
    }*/
}
